//
//  ControlCollectionViewCell.m
//  TeamInformatization
//
//  Created by bigger on 2019/3/31.
//  Copyright © 2019年 SPIC. All rights reserved.
//

#import "ControlCollectionViewCell.h"

@interface ControlCollectionViewCell ()

// 图片
@property (nonatomic, strong) UIImageView *imageView;
// 标题
@property (nonatomic, strong) SimpleLabel *controlTitle;

@end


@implementation ControlCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self creatCellView];
    }
    
    return self;
}

- (void)creatCellView
{
    self.imageView = [[UIImageView alloc] init];
    [self addSubview:_imageView];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(15 * kScaleWidth);
        make.centerX.mas_equalTo(self);
        make.size.mas_equalTo(CGSizeMake(46 * kScaleWidth, 46 * kScaleWidth));
    }];
    
    self.controlTitle = [SimpleLabel initWithText:@"" TextColor:kSetRGBColor(102, 102, 102, 1) TextFont:[UIFont systemFontOfSize:12] TextAlignment:NSTextAlignmentCenter];
    [self addSubview:_controlTitle];
    [_controlTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.imageView.mas_bottom).offset(5 * kScaleWidth);
        make.centerX.equalTo(self);
    }];
    
    
}

- (void)setShowViewCellWithTitle:(NSString *)title ImageStr:(NSString *)imageStr
{
    _imageView.image = [UIImage imageNamed:imageStr];
    
    _controlTitle.text = title;
    
}


@end
